﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XCommunity.Views;
using XCommunity.Forums.Views;
using XCommunity.Web;
using XCommunity.Web.UI;
using XCommunity;



public partial class Forums_Presenters_PanelFramePresenter : System.Web.UI.UserControl
{
  protected void Page_Load( object sender, EventArgs e )
  {
    var boardFrameView = View as BoardFrameView;

    if ( boardFrameView != null )
    {

      TopicListPlace.Visible = true;
      BoardFrameExtendInfo.Visible = true;


      if ( CommunityContext.CurrentIdentity != null && CommunityContext.CurrentIdentity.IsAuthenticated )
      {
        CreateTopicContainer.Visible = true;
        CreateTopicLink.NavigateUrl = string.Format( "LaunchTopic.aspx?route={0}&board={1}", HttpUtility.UrlEncode( (string) Page.Items["Route"] ), boardFrameView.BoardFrame.BoardId );
      }
    }

  }

  public string GetRoute()
  {
    return (string) Page.Items["Route"];
  }


  public PanelFrameView View
  {
    get { return (PanelFrameView) this.GetView(); }
  }
}
